//
//  PosterDetailView.m
//  时光电影项目
//
//  Created by 墨狂之逸才 on 15/7/25.
//  Copyright (c) 2015年 墨狂之逸才. All rights reserved.
//

#import "PosterDetailView.h"
#import "UIImageView+WebCache.h"
@implementation PosterDetailView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        
        
        
        
    }
    
    return self;
}

- (void)setModal:(MovieModal *)modal
{
    _modal = modal;
    
    //数据给了黄色星星
//    _StartView.average = modal.average;
    
    [self setNeedsLayout];
}


- (void)layoutSubviews
{
    
    _yearLabel.text = _modal.year;
    _ChinaNameLabel.text = _modal.title;

    
    NSString *average = [NSString stringWithFormat:@"%.1f", self.modal.average];
    self.averageLabel.text = average;
    
    
    
    NSString *str = [_modal.images objectForKey:@"medium"];
    
    [_imageView sd_setImageWithURL:[NSURL URLWithString:str]];
    
    
    StartView *view = (StartView *) _StartView;
    view.average = _modal.average;

    
    
}


@end
